// main.ts
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import { router } from './router'
import { createPinia } from 'pinia';
import { createPersistedState } from 'pinia-persistedstate-plugin' 
import 'element-plus/dist/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import * as echarts from "echarts"

import App from './App.vue'

const app = createApp(App)
const pinia = createPinia();
const persist = createPersistedState();
pinia.use(persist)

app.use(ElementPlus, {locale})
app.use(router)
app.use(pinia)
app.mount('#app')

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }